package com.wjw.java.oop.extends_.demo;

/**
 * 学生类：父类
 * 小学生和大学生可以继承
 */
public class Student {

    private String name;
    private int age;
    private int score;

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getScore() {
        return this.score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Student() {
        System.out.println("Student父类：无参构造");
    }

    public Student(String name, int age, int score) {
        this.name = name;
        this.age = age;
        this.score = score;
        System.out.println("Student父类：有参构造！！！");
    }

    public void showInfo(){
        System.out.println("姓名："+this.name+",年龄："+this.age+",成绩："+this.score);
    }
}
